package com.example.task1.ui.AllService.subway;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.example.task1.R;
import com.example.task1.bean.SubwayPathBean;
import com.example.task1.bean.SubwaySearchBean;
import com.example.task1.ui.BaseAdapter;

import java.util.ArrayList;
import java.util.List;

public class SubwaySearchPathAdapter extends BaseAdapter<SubwaySearchBean.DataDTO.LinesDTO> {

    private List<SubwaySearchBean.DataDTO.LinesDTO> mData = new ArrayList<>();
    private TextView tvName;

    @Override
    protected void setData(List<SubwaySearchBean.DataDTO.LinesDTO> rows) {
        mData = rows;
        notifyDataSetChanged();
    }

    @Override
    protected int getLayout() {
        return R.layout.subwaypathlist;
    }

    @Override
    protected Context getContext() {
        return null;
    }

    @Override
    protected List<SubwaySearchBean.DataDTO.LinesDTO> getData() {
        return mData;
    }

    @Override
    protected void onBind(myHolder holder, SubwaySearchBean.DataDTO.LinesDTO date) {
        tvName.setText(date.getLineName());
    }

    @Override
    protected void holder(View view) {
        initView(view);
    }

    private void initView(View view) {
        tvName = view.findViewById(R.id.tv_name);
    }
}
